package com.kly.sc.api.application.controller.user.response;

import com.kly.user.dto.UserBaseDto;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

@Data
public class UserBaseRsp {

    private String userCode;
    /**
     * 手机号
     */
    private String mobile;
    /**
     *邮箱
     */
    private String email;
    /**
     *用户昵称
     */
    private String nickName;

    /**
     * 用户类型
     */
    private Integer userType;

    private Integer status;

    private Boolean isUserValid;

    private String token;

    private Boolean isInit;

    /**
     *头像地址
     */
    private String avatarUrl;

    private String appsFlyerUid;

    private Integer online;

    private String extendInfo;

    /**
     *地理位置授权：1-已授权，其它未授权
     */
    private Integer gpsPrivilege;

    private Integer nearby;

    private Date gmtCreate;
    /**
     * 同一个用户多个登陆账号
     */
    private Boolean firstRegister;
    /**
     * 新、老户标记
     */
    private Boolean newUserFlag;

    /**
     * 渠道
     */
    private String channel;

    private String appCode;

    /**
     * 白名单标志：0-否 1-是
     */
    private Integer whiteUserFlag;
    /**
     * 1-Organic 2-None Organic 3-Other
     */
    private Integer trafficSource;
    /**
     * 1-flashchat 0-否
     */
    private Integer flashchatFlag;

    public static UserBaseRsp toRsp(UserBaseDto dto) {
        if (dto == null) {
            return null;
        }
        UserBaseRsp rsp = new UserBaseRsp();
        BeanUtils.copyProperties(dto, rsp);
        return rsp;
    }

}
